﻿#ifndef __X2D_PLATFORM_CONFIG_H__
#define __X2D_PLATFORM_CONFIG_H__

// Define supported target platform macro which CC uses.
#define X2_PLATFORM_UNKNOWN            0
#define X2_PLATFORM_IOS                1
#define X2_PLATFORM_ANDROID            2
#define X2_PLATFORM_WIN32              3
#define X2_PLATFORM_LINUX              4
#define X2_PLATFORM_MAC                5

// Determine target platform by compile environment macro.
#define X2_TARGET_PLATFORM             X2_PLATFORM_UNKNOWN

// iphone
#if ! X2_TARGET_PLATFORM && (defined(TARGET_OS_IPHONE) || defined(TARGET_IPHONE_SIMULATOR))
    #undef  X2_TARGET_PLATFORM
    #define X2_TARGET_PLATFORM         X2_PLATFORM_IOS
    #define X2_SUPPORT_PVRTC
#endif

// android
#if ! X2_TARGET_PLATFORM && defined(ANDROID)
    #undef  X2_TARGET_PLATFORM
    #define X2_TARGET_PLATFORM         X2_PLATFORM_ANDROID
#endif

// win32
#if ! X2_TARGET_PLATFORM && (defined(WIN32) && defined(_WINDOWS))
    #undef  X2_TARGET_PLATFORM
    #define X2_TARGET_PLATFORM         X2_PLATFORM_WIN32
#endif

// linux
#if ! X2_TARGET_PLATFORM && defined(LINUX)
    #undef  X2_TARGET_PLATFORM
    #define X2_TARGET_PLATFORM         X2_PLATFORM_LINUX
#endif

// mac
#if ! X2_TARGET_PLATFORM && defined(TARGET_OS_MAC)
    #undef  X2_TARGET_PLATFORM
    #define X2_TARGET_PLATFORM         X2_PLATFORM_MAC
#endif

#endif // __X2D_PLATFORM_CONFIG_H__